package cn.edu.pku.ss.lbs.position;

import java.util.ArrayList;
import java.util.List;

public abstract class SignalSource {
    private List<SignalProcessor> processors = new ArrayList<SignalProcessor>();

    public void addSignalProcessor(SignalProcessor processor) {
        if (processor == null) throw new NullPointerException();
        processors.add(processor);
    }

    protected void notifyProcessors(SignalRecord signal) {
        for (SignalProcessor processor : processors) processor.process(signal);
    }
}
